Ext.namespace("Ext.milan.pagejs.page_moduletypemanage");

var tree;
Ext.milan.pagejs.page_moduletypemanage.docLoadBeforeCallBack = function() {
};

Ext.milan.pagejs.page_moduletypemanage.docOnReadyCallback = function() {

	//Milan.ajaxutility.updateContentUseAjax("post","module/tree.do?appid="+$('appid').value,"module_left_data");
	//Milan.ajaxutility.updateContentUseAjax("post","directory/subDir.do?typeId=-1", "knowledgeTypeFrame_rightFrame");
	tree = new dhtmlXTreeObject("_module_tree","100%","100%",0);
	tree.setImagePath("skins/default/images/dhtmlx/tree/csh_bluebooks/");
	tree.setDataMode("json");
	tree.loadJSON("module/loadTreeData.do?appid="+$('appid').value);
	tree.attachEvent("onClick", function(itemId){
		var id = itemId==-1?-1:itemId;
		Milan.ajaxutility.updateContentUseAjax("GET", "module/listByPid.do?mdid="+id+"&appid="+$('appid').value, "module_data_list",{displayMasker:false,displayLoading:false});
	});
	
	$("_module_tree").style.height=jQuery("#_module_tree").parents("table").prop("offsetHeight")-46+"px";
	tree.attachEvent("onXLE",function(){
		$("_module_tree").removeChild($("holdinfo_module"));
		try{
			tree.openItem(tree.getItemIdByIndex(-1,0));
			tree.selectItem(-1, true);
		}
		catch(e){
		}
	});
};
